Currently, most software is written in text form (herein referred to as “source code”) in a programming language. Another program, called a compiler, translates program source code to program executable code. Runtime software is then typically used to assist in executing the program at “runtime,” which refers to the time at which the program executes.
Compilers and runtime software programs use what is called an evaluation scheme to determine how to generate executable code from source code and how to process executable code at runtime. An evaluation scheme is a technique for computing actual values (such as 7) from expressions (such as x+1) at runtime. An evaluation scheme generally takes as input both a fragment of executable code (such as the code x+1) and a program environment describing the values of local variables (such as the environment x=6) that are accessed by the executable code in determining the resulting value generated by the executable code in that context. The result of evaluation is typically either a simple value (such as 7) or an error code. Evaluation may also cause side effects (such as modifying the contents of mutable storage.)
One problem with existing programming languages, compilers and runtime software programs relates to recursive computations in programs. Specifically, an out-of-order recursive program is a computer program that is capable of accessing values before they have been sequentially evaluated. For example, “x=(x[1]+1,7)” defines an array “x” recursively. The first element is defined as the second element, x[1], plus one, and the second element is defined as 7. Thus the expected resulting value of the x is (8,7). To ascertain that, the second element had to be evaluated before the evaluation of the first element completed. Many programming languages, such as C and Java, do not support this style of out-of-order recursive programming, and instead expect the programmer to write only programs that access values subsequent to their sequential initialization.
Many types of problems may be solved more easily or compactly using recursive out-of-order programming constructs than traditional in-order programming constructs. Such out-of-order recursive programs present problems for existing evaluation schemes. Programmers must then avoid use of out-of-order recursive functions or recognize that the program may not operate fully as intended if the evaluation scheme is unable to properly handle the out-of-order recursive function.
These and other drawbacks exist with current systems.